/*
 * @Description:文件接口
 */
import axios from "axios";
import $baseurl from '@/api/baseURL'
export default {
    //上传文件
    upload(data) {
        return axios({
            url: `${$baseurl.fileServiceUrl}base/files/upload`,
            method: 'post',
            headers: {
                'Content-Type': 'multipart/form-data'
            },
            data,
            timeout: 0,
        })
    },
    //下载文件
    download(fileId) {
        return axios({
            url: `${$baseurl.fileServiceUrl}base/files/download?fileId=${fileId}`,
            method: 'get',
            responseType: 'blob',
            timeout: 0,
        })
    }
};
